package com.codeoss.framework.view.component;

import java.util.ArrayList;
import java.util.List;

import com.codeoss.framework.context.YunContext;

public abstract class Container extends Component {
	private List<Component> children = new ArrayList<Component>();
	
	public void addComponent(Component component) {
		children.add(component);
	}

	public List<Component> getChildren() {
		return children;
	}

	public void removeComponent(Component component) {
		children.remove(component);
	}

	public void findComponentById(YunContext yunContext,String id) {
		super.findComponentById(yunContext, id);
		for(int i=0;i<children.size();i++) {
			Component child=children.get(i);
			child.findComponentById(yunContext,id);
		}
	}
}
